package com.karaoke.android.kege.fragment


import android.os.Bundle
import android.support.v4.app.Fragment
import com.apkfuns.logutils.LogUtils
import com.karaoke.android.data.domain.DataDictionary
import com.karaoke.android.kege.BR
import com.karaoke.android.kege.R
import com.karaoke.android.kege.vm.SingerPageViewModel
import com.karaoke.android.library.mvvm.BindingConfig
import com.karaoke.android.library.mvvm.MvvmFragment
import kotlin.properties.Delegates


/**
 * A simple [Fragment] subclass.
 */
class SingerPageFragment : MvvmFragment<SingerPageViewModel>()
{
    companion object
    {
        fun newInstance(dataDictionary: DataDictionary) = SingerPageFragment().apply { this.area = dataDictionary }
    }

    var area: DataDictionary by Delegates.notNull()
    override val viewModel: SingerPageViewModel by lazy { SingerPageViewModel() }
    override val config: BindingConfig by lazy { BindingConfig(R.layout.fragment_singer_page, BR.viewModel) }

    override fun onCreate(savedInstanceState: Bundle?)
    {
        super.onCreate(savedInstanceState)
        area = arguments.getParcelable<DataDictionary>("area")
        viewModel.area = area
    }

    override fun onActivityCreated(savedInstanceState: Bundle?)
    {
        super.onActivityCreated(savedInstanceState)
        LogUtils.e("onActivityCreated")
    }

}
